# users/models.py
from django.db import models

class User(models.Model):
    id = models.AutoField(primary_key=True)  # 用户ID
    username = models.CharField(max_length=50)  # 用户昵称
    password_hash = models.CharField(max_length=128)  # 加密后的密码
    phone = models.CharField(max_length=20, unique=True)  # 手机号（唯一）
    created_at = models.DateTimeField(auto_now_add=True)  # 注册时间

    def __str__(self):
        return self.username
